<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>茶叶购买</title>
<link rel="stylesheet" href="../css/booksStyle.css">
<link rel="stylesheet" href="../css/footer.css">
<link rel="stylesheet"
	href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script
	src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script
	src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script language="javascript" type="text/javascript">
	function check(){
		var count = $("#count").val();
		if(count && parseInt(count) <= 0){
			alert("请输入大于0的数!");
			return false;
		}
		return true;
	}
</script>
</head>
<body>
	<jsp:include page="navbar.jsp" />

	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<h1 class="display-1 text-center">茶叶购买</h1>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-3"></div>
			<div class="col-md-6">
				<form name="form" action="addCart.action" method="post" onsubmit="return check();">
					<div class="form-group">
						<label>茶叶编号</label> <input type="text" class="form-control"
							placeholder="茶叶编号" name="id" id="id" value="${tea.id }"
							readonly="readonly">
					</div>
					<div class="form-group">
						<label>茶叶名称</label> <input type="text" class="form-control"
							placeholder="茶叶名称" value="${tea.name }" name="name" id="name"
							readonly="readonly">
					</div>
					<div class="form-group">
						<label>茶叶产地</label> <input type="text" class="form-control"
							placeholder="产地" name="from" value="${tea.from }" id="from"
							readonly="readonly">
					</div>
					<div class="form-group">
						<label>茶叶价格</label> <input type="text" class="form-control"
							placeholder="茶叶价格" name="price" id="price" value="${tea.price }"
							readonly="readonly">
					</div>
					<div class="form-group">
						<label>茶叶库存</label> <input type="text" class="form-control"
							placeholder="茶叶库存" name="stock" id="stock" readonly="readonly"
							value="${tea.stock }">
					</div>
					<c:if test="${user != null }">
						<div class="form-group">
							<label>购买数量</label> <input type="text" class="form-control"
								placeholder="1" name="count" id="count" required="required"
								value="1" id="count">
						</div>
					</c:if>
					<div class="form-group">
						<label>茶叶类型</label> <input type="text" class="form-control"
							placeholder="茶叶类型" name="type" id="phone" readonly="readonly"
							value="${tea.type }">
					</div>
					<div class="form-group">
						<label>茶叶简介</label> <input type="text" class="form-control"
							placeholder="茶叶简介" name="introduction" id="introduction"
							readonly="readonly" value="${tea.introduction }">
					</div>

					<div class="form-group">
						<c:if test="${user != null }">
							<button type="submit" class="btn btn-success">确定</button>
						</c:if>
						<input type="button" class="btn btn-primary" name="button"
							value="返回" onclick="javascript:history.go(-1)" />
					</div>
				</form>
			</div>
			<font color="red">${requestScope.errorMessage}</font>
		</div>
	</div>
</body>
</html>